import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: '',
    component: () => import('../views/layout'),
    redirect: '/home',
    children: [
      {
        path: 'home',
        name: '首页',
        component: () => import('../views/home/index')
      },
      {
        path: 'user',
        name: '管理员',
        component: () => import('../views/user/index')
      },
      {
        path: 'association',
        name: '商会管理',
        component: () => import('../views/association/index')
      },
      {
        path: 'member',
        name: '会员管理',
        component: () => import('../views/member/index')
      },
      {
        path: 'job',
        name: '招聘信息',
        component: () => import('../views/job/index')
      },
      {
        path: 'supplyDemand',
        name: '供求信息',
        component: () => import('../views/supplyDemand/index')
      },
      {
        path: 'role',
        name: '角色管理',
        component: () => import('../views/role/index')
      },
      {
        path: 'menu',
        name: '菜单管理',
        component: () => import('../views/menu/index')
      },
      {
        path: 'permission',
        name: '权限管理',
        component: () => import('../views/permission/index')
      }
    ]
  },
  {
    path: '/login',
    name: '登录',
    component: () => import('../views/login/index')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
